<?php
class Core_Model_DbTable_TidePorts extends Zend_Db_Table_Abstract
{
    protected $_name = 'tide_ports';
    
    public function getAll() {
        return $this->fetchAll();
    }
    
    public function batchDelete($ids) {
        $cond = $this->getAdapter()->quoteInto("id IN (?)", $ids);
        $this->delete($cond);
    }
    
    public function getGroups() {
        $select = $this->select()
                       ->from($this->_name)
                       ->order("region");
        $ports = $this->fetchAll($select);
        $result = array();
        foreach ($ports as $port) {
            $result[$port->region][] = $port;
        }
        return $result;
    }
}
?>
